added samples
[windows-sources.git] / sdk / samples / all in on code / Visual Studio 2008 / CSADONETDataServiceSL3Client / Service References / SchoolLinqToEntitiesService / Reference.cs
blob1b004724a737e20f3b11365349fbff613fdd309d
1 //------------------------------------------------------------------------------
2 // <auto-generated>
3 // This code was generated by a tool.
4 // Runtime Version:2.0.50727.4927
5 //
6 // Changes to this file may cause incorrect behavior and will be lost if
7 // the code is regenerated.
8 // </auto-generated>
9 //------------------------------------------------------------------------------
11 // Original file name:
12 // Generation date: 9/16/2009 8:05:44 PM
13 namespace CSADONETDataServiceSL3Client.SchoolLinqToEntitiesService
16 /// <summary>
17 /// There are no comments for SQLServer2005DBEntities in the schema.
18 /// </summary>
19 public partial class SQLServer2005DBEntities : global::System.Data.Services.Client.DataServiceContext
21 /// <summary>
22 /// Initialize a new SQLServer2005DBEntities object.
23 /// </summary>
24 public SQLServer2005DBEntities(global::System.Uri serviceRoot) :
25 base(serviceRoot)
27 this.ResolveName = new global::System.Func<global::System.Type, string>(this.ResolveNameFromType);
28 this.ResolveType = new global::System.Func<string, global::System.Type>(this.ResolveTypeFromName);
29 this.OnContextCreated();
31 partial void OnContextCreated();
32 /// <summary>
33 /// Since the namespace configured for this service reference
34 /// in Visual Studio is different from the one indicated in the
35 /// server schema, use type-mappers to map between the two.
36 /// </summary>
37 protected global::System.Type ResolveTypeFromName(string typeName)
39 if (typeName.StartsWith("SQLServer2005DBModel", global::System.StringComparison.Ordinal))
41 return this.GetType().Assembly.GetType(string.Concat("CSADONETDataServiceSL3Client.SchoolLinqToEntitiesService", typeName.Substring(20)), true);
43 return null;
45 /// <summary>
46 /// Since the namespace configured for this service reference
47 /// in Visual Studio is different from the one indicated in the
48 /// server schema, use type-mappers to map between the two.
49 /// </summary>
50 protected string ResolveNameFromType(global::System.Type clientType)
52 if (clientType.Namespace.Equals("CSADONETDataServiceSL3Client.SchoolLinqToEntitiesService", global::System.StringComparison.Ordinal))
54 return string.Concat("SQLServer2005DBModel.", clientType.Name);
56 return null;
58 /// <summary>
59 /// There are no comments for Course in the schema.
60 /// </summary>
61 public global::System.Data.Services.Client.DataServiceQuery<Course> Course
63 get
65 if ((this._Course == null))
67 this._Course = base.CreateQuery<Course>("Course");
69 return this._Course;
72 private global::System.Data.Services.Client.DataServiceQuery<Course> _Course;
73 /// <summary>
74 /// There are no comments for CourseGrade in the schema.
75 /// </summary>
76 public global::System.Data.Services.Client.DataServiceQuery<CourseGrade> CourseGrade
78 get
80 if ((this._CourseGrade == null))
82 this._CourseGrade = base.CreateQuery<CourseGrade>("CourseGrade");
84 return this._CourseGrade;
87 private global::System.Data.Services.Client.DataServiceQuery<CourseGrade> _CourseGrade;
88 /// <summary>
89 /// There are no comments for Person in the schema.
90 /// </summary>
91 public global::System.Data.Services.Client.DataServiceQuery<Person> Person
93 get
95 if ((this._Person == null))
97 this._Person = base.CreateQuery<Person>("Person");
99 return this._Person;
102 private global::System.Data.Services.Client.DataServiceQuery<Person> _Person;
103 /// <summary>
104 /// There are no comments for Course in the schema.
105 /// </summary>
106 public void AddToCourse(Course course)
108 base.AddObject("Course", course);
110 /// <summary>
111 /// There are no comments for CourseGrade in the schema.
112 /// </summary>
113 public void AddToCourseGrade(CourseGrade courseGrade)
115 base.AddObject("CourseGrade", courseGrade);
117 /// <summary>
118 /// There are no comments for Person in the schema.
119 /// </summary>
120 public void AddToPerson(Person person)
122 base.AddObject("Person", person);
125 /// <summary>
126 /// There are no comments for SQLServer2005DBModel.Course in the schema.
127 /// </summary>
128 /// <KeyProperties>
129 /// CourseID
130 /// </KeyProperties>
131 [global::System.Data.Services.Common.DataServiceKeyAttribute("CourseID")]
132 public partial class Course
134 /// <summary>
135 /// Create a new Course object.
136 /// </summary>
137 /// <param name="courseID">Initial value of CourseID.</param>
138 /// <param name="title">Initial value of Title.</param>
139 /// <param name="credits">Initial value of Credits.</param>
140 /// <param name="departmentID">Initial value of DepartmentID.</param>
141 public static Course CreateCourse(int courseID, string title, int credits, int departmentID)
143 Course course = new Course();
144 course.CourseID = courseID;
145 course.Title = title;
146 course.Credits = credits;
147 course.DepartmentID = departmentID;
148 return course;
150 /// <summary>
151 /// There are no comments for Property CourseID in the schema.
152 /// </summary>
153 public int CourseID
157 return this._CourseID;
161 this.OnCourseIDChanging(value);
162 this._CourseID = value;
163 this.OnCourseIDChanged();
166 private int _CourseID;
167 partial void OnCourseIDChanging(int value);
168 partial void OnCourseIDChanged();
169 /// <summary>
170 /// There are no comments for Property Title in the schema.
171 /// </summary>
172 public string Title
176 return this._Title;
180 this.OnTitleChanging(value);
181 this._Title = value;
182 this.OnTitleChanged();
185 private string _Title;
186 partial void OnTitleChanging(string value);
187 partial void OnTitleChanged();
188 /// <summary>
189 /// There are no comments for Property Credits in the schema.
190 /// </summary>
191 public int Credits
195 return this._Credits;
199 this.OnCreditsChanging(value);
200 this._Credits = value;
201 this.OnCreditsChanged();
204 private int _Credits;
205 partial void OnCreditsChanging(int value);
206 partial void OnCreditsChanged();
207 /// <summary>
208 /// There are no comments for Property DepartmentID in the schema.
209 /// </summary>
210 public int DepartmentID
214 return this._DepartmentID;
218 this.OnDepartmentIDChanging(value);
219 this._DepartmentID = value;
220 this.OnDepartmentIDChanged();
223 private int _DepartmentID;
224 partial void OnDepartmentIDChanging(int value);
225 partial void OnDepartmentIDChanged();
226 /// <summary>
227 /// There are no comments for CourseGrade in the schema.
228 /// </summary>
229 public global::System.Collections.ObjectModel.Collection<CourseGrade> CourseGrade
233 return this._CourseGrade;
237 if ((value != null))
239 this._CourseGrade = value;
243 private global::System.Collections.ObjectModel.Collection<CourseGrade> _CourseGrade = new global::System.Collections.ObjectModel.Collection<CourseGrade>();
244 /// <summary>
245 /// There are no comments for Person in the schema.
246 /// </summary>
247 public global::System.Collections.ObjectModel.Collection<Person> Person
251 return this._Person;
255 if ((value != null))
257 this._Person = value;
261 private global::System.Collections.ObjectModel.Collection<Person> _Person = new global::System.Collections.ObjectModel.Collection<Person>();
263 /// <summary>
264 /// There are no comments for SQLServer2005DBModel.CourseGrade in the schema.
265 /// </summary>
266 /// <KeyProperties>
267 /// EnrollmentID
268 /// </KeyProperties>
269 [global::System.Data.Services.Common.DataServiceKeyAttribute("EnrollmentID")]
270 public partial class CourseGrade
272 /// <summary>
273 /// Create a new CourseGrade object.
274 /// </summary>
275 /// <param name="enrollmentID">Initial value of EnrollmentID.</param>
276 public static CourseGrade CreateCourseGrade(int enrollmentID)
278 CourseGrade courseGrade = new CourseGrade();
279 courseGrade.EnrollmentID = enrollmentID;
280 return courseGrade;
282 /// <summary>
283 /// There are no comments for Property EnrollmentID in the schema.
284 /// </summary>
285 public int EnrollmentID
289 return this._EnrollmentID;
293 this.OnEnrollmentIDChanging(value);
294 this._EnrollmentID = value;
295 this.OnEnrollmentIDChanged();
298 private int _EnrollmentID;
299 partial void OnEnrollmentIDChanging(int value);
300 partial void OnEnrollmentIDChanged();
301 /// <summary>
302 /// There are no comments for Property Grade in the schema.
303 /// </summary>
304 public global::System.Nullable<decimal> Grade
308 return this._Grade;
312 this.OnGradeChanging(value);
313 this._Grade = value;
314 this.OnGradeChanged();
317 private global::System.Nullable<decimal> _Grade;
318 partial void OnGradeChanging(global::System.Nullable<decimal> value);
319 partial void OnGradeChanged();
320 /// <summary>
321 /// There are no comments for Course in the schema.
322 /// </summary>
323 public Course Course
327 return this._Course;
331 this._Course = value;
334 private Course _Course;
335 /// <summary>
336 /// There are no comments for Person in the schema.
337 /// </summary>
338 public Person Person
342 return this._Person;
346 this._Person = value;
349 private Person _Person;
351 /// <summary>
352 /// There are no comments for SQLServer2005DBModel.Person in the schema.
353 /// </summary>
354 /// <KeyProperties>
355 /// PersonID
356 /// </KeyProperties>
357 [global::System.Data.Services.Common.DataServiceKeyAttribute("PersonID")]
358 public partial class Person
360 /// <summary>
361 /// Create a new Person object.
362 /// </summary>
363 /// <param name="personID">Initial value of PersonID.</param>
364 /// <param name="lastName">Initial value of LastName.</param>
365 /// <param name="firstName">Initial value of FirstName.</param>
366 /// <param name="personCategory">Initial value of PersonCategory.</param>
367 public static Person CreatePerson(int personID, string lastName, string firstName, short personCategory)
369 Person person = new Person();
370 person.PersonID = personID;
371 person.LastName = lastName;
372 person.FirstName = firstName;
373 person.PersonCategory = personCategory;
374 return person;
376 /// <summary>
377 /// There are no comments for Property PersonID in the schema.
378 /// </summary>
379 public int PersonID
383 return this._PersonID;
387 this.OnPersonIDChanging(value);
388 this._PersonID = value;
389 this.OnPersonIDChanged();
392 private int _PersonID;
393 partial void OnPersonIDChanging(int value);
394 partial void OnPersonIDChanged();
395 /// <summary>
396 /// There are no comments for Property LastName in the schema.
397 /// </summary>
398 public string LastName
402 return this._LastName;
406 this.OnLastNameChanging(value);
407 this._LastName = value;
408 this.OnLastNameChanged();
411 private string _LastName;
412 partial void OnLastNameChanging(string value);
413 partial void OnLastNameChanged();
414 /// <summary>
415 /// There are no comments for Property FirstName in the schema.
416 /// </summary>
417 public string FirstName
421 return this._FirstName;
425 this.OnFirstNameChanging(value);
426 this._FirstName = value;
427 this.OnFirstNameChanged();
430 private string _FirstName;
431 partial void OnFirstNameChanging(string value);
432 partial void OnFirstNameChanged();
433 /// <summary>
434 /// There are no comments for Property PersonCategory in the schema.
435 /// </summary>
436 public short PersonCategory
440 return this._PersonCategory;
444 this.OnPersonCategoryChanging(value);
445 this._PersonCategory = value;
446 this.OnPersonCategoryChanged();
449 private short _PersonCategory;
450 partial void OnPersonCategoryChanging(short value);
451 partial void OnPersonCategoryChanged();
452 /// <summary>
453 /// There are no comments for Property HireDate in the schema.
454 /// </summary>
455 public global::System.Nullable<global::System.DateTime> HireDate
459 return this._HireDate;
463 this.OnHireDateChanging(value);
464 this._HireDate = value;
465 this.OnHireDateChanged();
468 private global::System.Nullable<global::System.DateTime> _HireDate;
469 partial void OnHireDateChanging(global::System.Nullable<global::System.DateTime> value);
470 partial void OnHireDateChanged();
471 /// <summary>
472 /// There are no comments for Property EnrollmentDate in the schema.
473 /// </summary>
474 public global::System.Nullable<global::System.DateTime> EnrollmentDate
478 return this._EnrollmentDate;
482 this.OnEnrollmentDateChanging(value);
483 this._EnrollmentDate = value;
484 this.OnEnrollmentDateChanged();
487 private global::System.Nullable<global::System.DateTime> _EnrollmentDate;
488 partial void OnEnrollmentDateChanging(global::System.Nullable<global::System.DateTime> value);
489 partial void OnEnrollmentDateChanged();
490 /// <summary>
491 /// There are no comments for Property Picture in the schema.
492 /// </summary>
493 public byte[] Picture
497 if ((this._Picture != null))
499 return ((byte[])(this._Picture.Clone()));
501 else
503 return null;
508 this.OnPictureChanging(value);
509 this._Picture = value;
510 this.OnPictureChanged();
513 private byte[] _Picture;
514 partial void OnPictureChanging(byte[] value);
515 partial void OnPictureChanged();
516 /// <summary>
517 /// There are no comments for CourseGrade in the schema.
518 /// </summary>
519 public global::System.Collections.ObjectModel.Collection<CourseGrade> CourseGrade
523 return this._CourseGrade;
527 if ((value != null))
529 this._CourseGrade = value;
533 private global::System.Collections.ObjectModel.Collection<CourseGrade> _CourseGrade = new global::System.Collections.ObjectModel.Collection<CourseGrade>();
534 /// <summary>
535 /// There are no comments for Course in the schema.
536 /// </summary>
537 public global::System.Collections.ObjectModel.Collection<Course> Course
541 return this._Course;
545 if ((value != null))
547 this._Course = value;
551 private global::System.Collections.ObjectModel.Collection<Course> _Course = new global::System.Collections.ObjectModel.Collection<Course>();